<nz-card [nzBordered]="false">
  <section class="search-section">
    <nz-select [(ngModel)]="parentId" [nzPlaceHolder]="'申请渠道'" class="search-item" [nzAllowClear]="true" [nzShowSearch]="true">
      <nz-option
        *ngFor="let option of allAgent"
        [nzLabel]="option.name"
        [nzValue]="option.id">
      </nz-option>
    </nz-select>
    <nz-select [(ngModel)]="childId" [nzPlaceHolder]="'升级渠道'" class="search-item" [nzAllowClear]="true" [nzShowSearch]="true">
      <nz-option
        *ngFor="let option of allAgent"
        [nzLabel]="option.name"
        [nzValue]="option.id">
      </nz-option>
    </nz-select>
    <button nz-button [nzType]="'primary'" nzGhost (click)="search()" class="search-item">
      <i class="anticon anticon-search"></i><span>搜索</span>
    </button>
  </section>
  <nz-table #nzTable [nzData]="page.content"
            [nzPageSize]="page.size"
            [nzTotal]="page.totalElements"
            [nzFrontPagination]="false"
            [(nzPageIndex)]="page.number"
            (nzPageIndexChange)="changePageNo($event)"
            [nzLoading]="isLoading">
    <thead>
    <tr>
      <th nz-th><span>序号</span></th>
      <th nz-th><span>申请渠道</span></th>
      <th nz-th><span>渠道手机</span></th>
      <th nz-th><span>升级渠道</span></th>
      <th nz-th><span>升级渠道级别</span></th>
      <th nz-th><span>申请时间</span></th>
      <th nz-th *ngIf="status == 3"><span>拒绝原因</span></th>
      <th nz-th *ngIf="status == 1"><span>操作</span></th>
    </tr>
    </thead>
    <tbody>
    <tr *ngFor="let data of nzTable.data;let i=index">
      <td>
        {{i+1}}
      </td>
      <td>{{data.parentId|dicsNamePipe:allAgent:"id":"name"}}</td>
      <td>{{data.parentId|dicsNamePipe:allAgent:"id":"phone"}}</td>
      <td>{{data.childId|dicsNamePipe:allAgent:"id":"name"}}</td>
      <td>{{(data.childId|dicsNamePipe:allAgent:"id":"levelId")|dicsNamePipe:levelOptions:"id":"name"}}</td>
      <td>{{data.saveDate}}</td>
      <td  *ngIf="status == 3" [title]="data.remark">{{data.remark|stringEllipsisCutPipe:30}}</td>
      <td *ngIf="status == 1">
        <nz-popconfirm [nzTitle]="'确定要同意该申请吗？'" (nzOnConfirm)="agree(data)">
          <a nz-popconfirm>通过</a>
        </nz-popconfirm>
        <nz-divider nzType="vertical"></nz-divider>
        <nz-popconfirm [nzTitle]="'确定要驳回该申请吗？'" (nzOnConfirm)="reject(data)">
          <a nz-popconfirm>不通过</a>
        </nz-popconfirm>
      </td>
    </tr>
    </tbody>
  </nz-table>
</nz-card>
